package com.gxa.feedback.controller;

import com.gxa.common.R;
import com.gxa.common.entity.platform_maintenance_service1001.PlatformNotice;
import com.gxa.feedback.service.PlatFormNoticeService;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/platformNotice")
public class PlatformNoticeController {

    @Autowired
    private PlatFormNoticeService platFormNoticeService;

    /**
     * 1.分页查询
     * @param currentPage
     * @param pageSize
     * @return
     */
    @GetMapping("/selectPlatFormNoticeByPage")
    public R selectPlatFormNoticeByPage(Integer currentPage, Integer pageSize){
        return platFormNoticeService.selectPlatFormNoticeByPage(currentPage,pageSize);
    }

    /**
     * 2.根据id修改
     * @param platformNotice
     * @return
     */
    @PostMapping("/updatePlatFormNotice")
    public R updatePlatFormNotice(@RequestBody PlatformNotice platformNotice){
        return platFormNoticeService.updatePlatFormNotice(platformNotice);
    }

    /**
     * 3.条件查询
     * @param platformNotice
     * @return
     */
    @PostMapping("/selectPlatFormNoticeCondition")
    public R selectPlatFormNoticeCondition(@RequestBody PlatformNotice platformNotice){
        return platFormNoticeService.selectPlatFormNotice(platformNotice);
    }

    /**
     * 4.根据id批量删除
     * @param ids
     * @return
     */
    @GetMapping("/delPlatFormNoticeByIdS")
    public R delPlatFormNoticeByIdS(@RequestParam List<Integer> ids){
        return platFormNoticeService.delPlatFormNoticeByIdS(ids);
    }

    /**
     * 5.添加
     * @param platformNotice
     * @return
     */
    @PostMapping("/addPlatFormNotice")
    public R addPlatFormNotice(@RequestBody PlatformNotice platformNotice){
        return platFormNoticeService.addPlatFormNotice(platformNotice);
    }

    /**
     * 6.查询全部
     * @return
     */
    @PostMapping("/selectAll")
    public R selectAll(){
        return platFormNoticeService.selectAll();
    }

    /**
     * 7.根据id查询
     * @param platformNotice
     * @return
     */
    @PostMapping("/selectPlatFormById")
    public R selectPlatFormById(@RequestBody PlatformNotice platformNotice){
        return platFormNoticeService.selectPlatFormById(platformNotice);
    }

    /**
     * 停用状态
     * @param id
     * @return
     */
    @GetMapping("/stopPlatFormById")
    public R stopPlatFormById(long id){
        return platFormNoticeService.stopPlatFormById(id);
    }



}
